package com.paw.ruoyi.admin.controller;

import com.paw.ruoyi.admin.common.domain.Result;
import com.paw.ruoyi.admin.core.resource.IUploadFileResource;
import com.paw.ruoyi.admin.service.IFileUploadService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Rubble
 * @date 2022/4/24
 **/
@RestController
public class CommonUploadController implements IUploadFileResource {


  @Autowired
  private IFileUploadService fileUploadService;

  @ApiOperation("获取域名")
  @Override
  public Result<String> getDomainUrl () {
    return fileUploadService.getDomainUrl();
  }

  @ApiOperation("获取url")
  @Override
  public Result<String> getUrl (String key) {
    return fileUploadService.getUrl(key);
  }

  @ApiOperation("获取名称key")
  @Override
  public Result<String> getKey (String url) {
    return fileUploadService.getKey(url);
  }
}
